package webTest.context;

import java.io.FileNotFoundException;
import java.io.FileReader;
import java.io.IOException;
import java.util.Properties;

/**
 * Created by IFT8
 * Date: 2014/12/30 18:33
 */
public class PropClassLoad {
    public String getName(){
        String name=null;
        String path=PropClassLoad.class.getClassLoader().getResource("../../config.properties").getPath();
        Properties properties=new Properties();
        try {
            FileReader fileReader=new FileReader(path);
            properties.load(fileReader);
            name=properties.getProperty("name");
        } catch (FileNotFoundException e) {
            e.printStackTrace();
        } catch (IOException e) {
            e.printStackTrace();
        }
        return name;
    }
}
